<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>部门比对数据</title>
		<link rel="stylesheet" type="text/css" href="asserts/bootstrap-3.3.7-dist/css/bootstrap.min.css"/>
	
		<!-- js插件 -->
		<script src="js/jquery-3.2.1.min.js"></script>
		<script src="asserts/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
        <link rel="stylesheet" type="text/css" href="asserts/bootstrapValidate/css/bootstrapValidator.min.css"/>
 	   <script src="asserts/bootstrapValidate/js/bootstrapValidator.min.js"></script>
	
	</head>
	<body>
			<!-- 内容展示区 -->
			<div >
					<!-- 导航 -->
					<ol class="breadcrumb">
						<li><i class="fa fa-comment"></i> 部门比对数据</li>
					</ol>
					<div class="container-fluid">
						<!-- 	内容面板 -->
						<div class="panel panel-default">
							<!-- 控制按钮 -->
							<div class="panel-heading">
									<div class="btn-group">
										<button class="btn btn-primary" data-toggle="modal" data-target="#mymodal" ><span class="glyphicon glyphicon-pencil"></span>添加</button>
										<button class="btn btn-success"><span class="glyphicon glyphicon-import"></span>导入excel</button>
										<button class="btn btn-info"><span class="glyphicon glyphicon-export"></span>导出excel模板</button>
									</div>
							</div><!-- 控制按钮  end-->
							<div class="panel-body">
								<table id="listtable" class="table table-bordered table-striped">
									<tr>
										<th width="5%"><input type="checkbox" name="" id="selectAll" /></th>
										<th width="5%">ID</th>
										<th width="10%">姓名</th>
										<th width="10%">身份证号</th>
 										<th width="5%">学校名称</th>
										<th width="5%">学段</th>
										<th width="5%">比对反馈类型</th>
										<th width="5%">证件号码/建档立卡人口编号</th>
										<th width="15%">操作</th>
									</tr>
									<!-- 数据绑定 -->
									<!-- <tr>
										<td><input type="checkbox" name="" class="eid" id="" /></td>
										<th width="5%">1</th>
										<th width="10%">李华</th>
										<th width="10%">421003201909092321</th>
										<th width="10%">藏龙岛小学</th>
										<th width="5%">888888</th>
										<th width="5%">农村低保</th>
										<th width="5%">123456789</th>
										<th width="10%">1001</th>
										<td>
											<button type="button" class="btn btn-primary" 
												data-toggle="modal" data-target="#mymodal" >
												 <span class="glyphicon glyphicon-edit"></span> 修改</button>
											 <button type="button" class="btn btn-danger"> 
											 	<span class="glyphicon glyphicon-remove"></span> 删除</button>
										</td>
									</tr> -->
									<!-- 	数据绑定 end -->
								</table>
								<!-- 	分页 -->
									<nav class="text-center">
									<ul class="pagination pagination-sm">
										<li class="disabled"><a href="javascript:void(0)">&laquo;</a></li>
										<li class="active"><a href="">1</a></li>
										<li><a href="">2</a></li>
										<li><a href="">3</a></li>
										<li><a href="">...</a></li>
										<li><a href="">49</a></li>
										<li><a href="">50</a></li>
										<li><a href="">&raquo;</a></li>
									</ul>
									</nav>
							</div>
						</div><!-- 内容面板 end -->
					</div>
			</div><!-- 	内容展示区 end-->
	 
		
		<!-- 弹层组件 添加标签 -->
		<div class="modal fade" id="mymodal">
			<div class="modal-dialog">
				<div class="modal-content">
					<form action=""  class="form-horizontal">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
							<h4 class="modal-title" id="mylabel">部门比对数据信息</h4>
						</div>
						<div class="modal-body">
							  
							  <!-- 学校-->
								<div class="form-group">
									<label class="control-label col-md-3">姓名：</label>
									<div class="col-md-8">
										<input type="text" name="name" placeholder="请输入姓名" class="form-control"  />
									</div>
								</div>
								  <!-- 学校-->
								<div class="form-group">
									<label class="control-label col-md-3">身份证号：</label>
									<div class="col-md-8">
										<input type="text" name="idcard" placeholder="请输入身份证号" class="form-control"  />
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">学校名称：</label>
									<div class="col-md-8">
										 	<input type="text" name="schoolname" placeholder="请输入学校名称" class="form-control"  />
									</div>
								</div>
									<div class="form-group">
									<label class="control-label col-md-3">学段：</label>
									<div class="col-md-8">
										<input type="text" name="level" placeholder="请输入学段" class="form-control"  />
									</div>
								</div>
							  		<div class="form-group">
									<label class="control-label col-md-3">比对反馈类型：</label>
									<div class="col-md-8">
										<select name="comparetype" class="form-control">
											<option value="">请选择</option>
											<option value="农村低保">农村低保</option>
											<option value="城市低保">城市低保</option>
											<option value="农村五保">农村五保</option>
											<option value="孤儿">孤儿</option>
											<option value="持证残疾人">持证残疾人</option>
										</select> 
									</div>
								</div>
								<div class="form-group">
									<label class="control-label col-md-3">证件号码 / 建档立卡人口编号：</label>
									<div class="col-md-8">
										<input type="text" name="cardtype" placeholder="请输入证件号码/建档立卡人口编号" class="form-control"  />
									</div>
								<!-- </div>
									<div class="form-group">
									<label class="control-label col-md-3">所属学校id：</label>
									<div class="col-md-8">
										<input type="text" name="schid" placeholder="请输入所属学校id" class="form-control"  />
									</div>
								</div> -->
									
								<!-- <div class="form-group">
									<label class="control-label col-md-3">所属学校：</label>
									<div class="col-md-8">
									 <select name="schid" class="form-control">
											<option value="">请选择</option>
										 
										</select> 
									</div>
								</div> -->
							 
						</div>
						<div class="modal-footer">
							<button class="btn btn-danger" type="button">关闭</button>
							<button class="btn btn-primary" type="submit">录入</button>
						</div>
					</form>
				</div>
			</div>
		</div><!-- 弹层组件 添加标签 end -->
	 
	</body>
	<!-- 弹层组件 添加标签 end -->
	<script type="text/javascript">
		$(function() {
			//alert("进来了");
			// 页面加载时  查询 分类 并放入 div中 
			$.ajax({
				type : "post",
				url : "departlist/listJson",
				dataType : "JSON",
				success : function(result) {
					//alert("进来了");
					var table = $("#listtable");
					for (var i = 0; i < result.list.length; i++) {
						table.append("<tr><td><input type='checkbox' name='' class='eid' id='' /></td><td>"
								+ result.list[i].id
								+ "</td><td>"
								+ result.list[i].name
								+"</td><td>"
								+ result.list[i].idcard
								+"</td><td>"
								+ result.list[i].schoolname
								+"</td><td>"
								+ result.list[i].level
								+"</td><td>"
								+ result.list[i].comparetype
								+"</td><td>"
								+ result.list[i].cardtype
								+"</td><td><button type='button' class='btn btn-primary' data-toggle='modal' data-target='#mymodal' ><span class='glyphicon glyphicon-edit'></span> 修改</button><button type='button' class='btn btn-danger'><span class='glyphicon glyphicon-remove'></span> 删除</button></td></tr>");
					}/* onClick=\"fhbut('"	+ "'),syalert.syopen('alert1')\" */
				}
			});
		})
		
		//点击删除时候发送ajax到后台删除
		//$("#btnclass").click(
			function deteleById(id) {
				// 页面加载时  查询 分类 并放入 div中 
				//alert(id);
				$.ajax({
					type : "post",
					url : "countrysub/deleteById",
					data : "id=" + id,
					//dataType : "JSON",
					success : function(result) {
						//alert(result);
						if(result==1){
							alert("删除成功");
						}else{
							alert("删除失败");
						}
					}
			});
		}
		
	</script>
	<script type="text/javascript">
	 $(function () {
	  
        $('form').bootstrapValidator({
　　　　　　　　message: 'This value is not valid',
            　feedbackIcons: {
                　　　　　　　　valid: 'glyphicon glyphicon-ok',
                　　　　　　　　invalid: 'glyphicon glyphicon-remove',
                　　　　　　　　validating: 'glyphicon glyphicon-refresh'
            　　　　　　　　   },
            fields: {
                name: {
                    message: '用户名验证失败',
                    validators: {
                        notEmpty: {
                            message: '姓名不能为空'
                        }
                    }
                },
                idcard: {
                    validators: {
                        notEmpty: {
                            message: '身份证号不能为空'
                        }
                    }
                },
                stucode: {
                    validators: {
                        notEmpty: {
                            message: '学籍号不能为空'
                        }
                    }
                } ,schid: {
                    validators: {
                        notEmpty: {
                            message: '学校不能为空'
                        }
                    }
                }
            } ,
            submitHandler: function (validator, form, submitButton) {
              // alert("submit");
            }
        });
    });
	
</script>
</html>
